package com.intellif.oom;

import java.lang.String;

/**
 * @author by mozping
 * @Classname HeapOOM
 * @Description TODO
 * @Date 2019/8/13 13:52
 */
public class HeapOOM {

    /**
     * 添加虚拟机参数：-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
     * */
    static int size = 10 * 1024 * 1024;

    public static void main(String[] args) {
        while (true) {
            int[] ints = new int[size];
        }
    }
}